home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
cool
/
ge_cool.lha
/
GE_COOL2.1
/
cpp
/
tests
/
template_sample.i
< prev
Wrap
Text File
|
1992-04-13
|
598b
|
47 lines
#line 1 "template_sample.c"
#line 28 "template_sample.c"
extern void* error (char*);
;
;
;
typedef char* charP;
#line 30 "template_sample.c"
class Vector_charP {
charP* v;
int sz;
public:
Vector_charP(int);
charP& operator[](int);
inline charP& elem(int i) { return v[i]; }
};
#line 52 "template_sample.c"
;
#line 40 "template_sample.c"
charP& Vector_charP::operator[](int i)
{
if (i<0 || sz<=i) error("vector: range error");
return elem(i);
}
#line 47 "template_sample.c"
Vector_charP::Vector_charP(size)
{
v = new(charP[size]);
}
#line 53 "template_sample.c"
;
Vector_charP vs(30);